﻿namespace HuaWei.Search
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using HuaWei.BusinessRule;
    using HuaWei.CommClass;
    using HuaWei.DAI;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    public class FrmSearch : Form
    {
        private BindingSource bindingSource;
        private CBaseRule cbaseRule;
        private GridColumn gridColumn1;
        private GridColumn gridColumn2;
        private GridColumn gridColumn3;
        private GridColumn gridColumn4;
        private GridColumn gridColumn5;
        private GridColumn gridColumn6;
        private GridColumn gridColumn8;
        private GridColumn gridColumn7;
        private GridControl gridControl1;
        private GridView gridView1;
        private IContainer icontainer = null;
        private IDataAccess lquywmUul;
        public string OldBDID = "";
        private RepositoryItemTextEdit repositoryItemTextEdit1;
        private GridColumn vroAaJyIa;
        private XtraTabControl xtraTabControl2;
        private XtraTabPage xtraTabPage1;
        private XtraTabPage xtraTabPage2;
        private XtraTabPage xtraTabPage3;

        public FrmSearch()
        {
            this.InitializeComponent();
        }

        protected override void DefWndProc(ref Message m)
        {
            switch (m.Msg)
            {
                case 0x60:
                    this.method();
                    return;

                case 0x62:
                    this.method();
                    return;
            }
            base.DefWndProc(ref m);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer != null))
            {
                this.icontainer.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmSearch_Load(object sender, EventArgs e)
        {
            this.cbaseRule = new CBaseRule();
            this.lquywmUul = this.cbaseRule.GetDataAccess();
        }

        private void InitializeComponent()
        {
            this.icontainer = new Container();
            this.xtraTabControl2 = new XtraTabControl();
            this.xtraTabPage2 = new XtraTabPage();
            this.gridControl1 = new GridControl();
            this.bindingSource = new BindingSource(this.icontainer);
            this.gridView1 = new GridView();
            this.gridColumn1 = new GridColumn();
            this.gridColumn2 = new GridColumn();
            this.gridColumn3 = new GridColumn();
            this.gridColumn4 = new GridColumn();
            this.gridColumn5 = new GridColumn();
            this.gridColumn6 = new GridColumn();
            this.repositoryItemTextEdit1 = new RepositoryItemTextEdit();
            this.vroAaJyIa = new GridColumn();
            this.gridColumn8 = new GridColumn();
            this.gridColumn7 = new GridColumn();
            this.xtraTabPage1 = new XtraTabPage();
            this.xtraTabPage3 = new XtraTabPage();
            this.xtraTabControl2.BeginInit();
            this.xtraTabControl2.SuspendLayout();
            this.xtraTabPage2.SuspendLayout();
            this.gridControl1.BeginInit();
            ((ISupportInitialize)this.bindingSource).BeginInit();
            this.gridView1.BeginInit();
            this.repositoryItemTextEdit1.BeginInit();
            base.SuspendLayout();
            this.xtraTabControl2.Dock = DockStyle.Fill;
            this.xtraTabControl2.HeaderLocation = TabHeaderLocation.Left;
            this.xtraTabControl2.HeaderOrientation = TabOrientation.Horizontal;
            this.xtraTabControl2.Location = new Point(0, 0);
            this.xtraTabControl2.Name = "xtraTabControl2";
            this.xtraTabControl2.SelectedTabPage = this.xtraTabPage2;
            this.xtraTabControl2.Size = new Size(0x32e, 0x144);
            this.xtraTabControl2.TabIndex = 20;
            this.xtraTabControl2.TabPages.AddRange(new XtraTabPage[] { this.xtraTabPage2, this.xtraTabPage1, this.xtraTabPage3 });
            this.xtraTabPage2.Controls.Add(this.gridControl1);
            this.xtraTabPage2.Name = "xtraTabPage2";
            this.xtraTabPage2.Size = new Size(0x2d1, 0x13d);
            this.xtraTabPage2.Text = "计量台帐查询";
            this.gridControl1.DataSource = this.bindingSource;
            this.gridControl1.Dock = DockStyle.Fill;
            this.gridControl1.Location = new Point(0, 0);
            this.gridControl1.MainView = this.gridView1;
            this.gridControl1.Name = "gridControl1";
            this.gridControl1.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemTextEdit1 });
            this.gridControl1.Size = new Size(0x2d1, 0x13d);
            this.gridControl1.TabIndex = 0;
            this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView1 });
            this.gridView1.Columns.AddRange(new GridColumn[] { this.gridColumn1, this.gridColumn2, this.gridColumn7, this.gridColumn3, this.gridColumn4, this.gridColumn5, this.gridColumn6, this.vroAaJyIa, this.gridColumn8 });
            this.gridView1.GridControl = this.gridControl1;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsBehavior.ReadOnly = true;
            this.gridView1.OptionsCustomization.AllowFilter = false;
            this.gridView1.OptionsCustomization.AllowGroup = false;
            this.gridView1.OptionsCustomization.AllowSort = false;
            this.gridView1.OptionsView.ColumnAutoWidth = false;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.gridColumn1.Caption = "期号";
            this.gridColumn1.FieldName = "qcid";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 0;
            this.gridColumn1.Width = 0x37;
            this.gridColumn2.Caption = "原合同金额";
            this.gridColumn2.DisplayFormat.FormatString = "0";
            this.gridColumn2.DisplayFormat.FormatType = FormatType.Numeric;
            this.gridColumn2.FieldName = "htje";
            this.gridColumn2.Name = "gridColumn2";
            this.gridColumn2.Visible = true;
            this.gridColumn2.VisibleIndex = 1;
            this.gridColumn2.Width = 90;
            this.gridColumn7.Caption = "施工图金额";
            this.gridColumn7.DisplayFormat.FormatString = "0";
            this.gridColumn7.DisplayFormat.FormatType = FormatType.Numeric;
            this.gridColumn7.FieldName = "sgtje";
            this.gridColumn7.Name = "gridColumn7";
            this.gridColumn7.Visible = true;
            this.gridColumn7.VisibleIndex = 1;
            this.gridColumn7.Width = 90;
            this.gridColumn3.Caption = "变更增减金额";
            this.gridColumn3.FieldName = "bgje";
            this.gridColumn3.Name = "gridColumn3";
            this.gridColumn3.Visible = true;
            this.gridColumn3.VisibleIndex = 2;
            this.gridColumn3.Width = 0x62;
            this.gridColumn4.Caption = "变更后金额";
            this.gridColumn4.DisplayFormat.FormatString = "0";
            this.gridColumn4.DisplayFormat.FormatType = FormatType.Numeric;
            this.gridColumn4.FieldName = "bghje";
            this.gridColumn4.Name = "gridColumn4";
            this.gridColumn4.Visible = true;
            this.gridColumn4.VisibleIndex = 3;
            this.gridColumn4.Width = 0x5e;
            this.gridColumn5.Caption = "本期计量金额";
            this.gridColumn5.FieldName = "bqjlje";
            this.gridColumn5.Name = "gridColumn5";
            this.gridColumn5.Visible = true;
            this.gridColumn5.VisibleIndex = 4;
            this.gridColumn5.Width = 0x54;
            this.gridColumn6.Caption = "本期计量占比 %";
            this.gridColumn6.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridColumn6.DisplayFormat.FormatString = "0.00";
            this.gridColumn6.DisplayFormat.FormatType = FormatType.Numeric;
            this.gridColumn6.FieldName = "bqjlbl";
            this.gridColumn6.Name = "gridColumn6";
            this.gridColumn6.Visible = true;
            this.gridColumn6.VisibleIndex = 5;
            this.gridColumn6.Width = 100;
            this.repositoryItemTextEdit1.AutoHeight = false;
            this.repositoryItemTextEdit1.DisplayFormat.FormatString = "0.00";
            this.repositoryItemTextEdit1.DisplayFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit1.EditFormat.FormatString = "0.00";
            this.repositoryItemTextEdit1.EditFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
            this.vroAaJyIa.Caption = "累计计量金额";
            this.vroAaJyIa.FieldName = "bqmjlje";
            this.vroAaJyIa.Name = "gridColumn7";
            this.vroAaJyIa.Visible = true;
            this.vroAaJyIa.VisibleIndex = 6;
            this.vroAaJyIa.Width = 0x54;
            this.gridColumn8.Caption = "累计计量占比 %";
            this.gridColumn8.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridColumn8.DisplayFormat.FormatString = "0.00";
            this.gridColumn8.DisplayFormat.FormatType = FormatType.Numeric;
            this.gridColumn8.FieldName = "ljjlbl";
            this.gridColumn8.Name = "gridColumn8";
            this.gridColumn8.Visible = true;
            this.gridColumn8.VisibleIndex = 7;
            this.gridColumn8.Width = 110;
            this.xtraTabPage1.Name = "xtraTabPage1";
            this.xtraTabPage1.Size = new Size(0x2d1, 0x13d);
            this.xtraTabPage1.Text = "变更令查询";
            this.xtraTabPage3.Name = "xtraTabPage3";
            this.xtraTabPage3.Size = new Size(0x2d1, 0x13d);
            this.xtraTabPage3.Text = "变更完成查询";
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x32e, 0x144);
            base.Controls.Add(this.xtraTabControl2);
            base.Name = "FrmSearch";
            this.Text = "综合查询";
            base.Load += new EventHandler(this.FrmSearch_Load);
            this.xtraTabControl2.EndInit();
            this.xtraTabControl2.ResumeLayout(false);
            this.xtraTabPage2.ResumeLayout(false);
            this.gridControl1.EndInit();
            ((ISupportInitialize)this.bindingSource).EndInit();
            this.gridView1.EndInit();
            this.repositoryItemTextEdit1.EndInit();
            base.ResumeLayout(false);
        }

        private void method()
        {
            Class39.smethod12(GParams._BDID);
            DataTable dt = DBHelp.GetDt(CHelp.smethod1(string.Format(CSearchSQL.SEARCH_JLTZ, GParams._BDID)), "JLTZ");
            this.bindingSource.DataSource = dt;
        }
    }
}

